<pdf>
    <dynamic-page page-size="a4">
        <div>
            {% set total_ht = 0 %}
            {% set total_ttc = 0 %}
            {% for ligne in lignes %}
                {% if ligne.quantiteBlanc>0 %}
            <table width="100%">
                <tr>
                    <td width="16%"  text-align="center" height="15">{{ ligne.article.reference }}</td>
                    <td width="37%"  height="15">{{ ligne.article.designation }}</td>
                    <td width="8%"  text-align="center" height="15">{{ ligne.quantiteBlanc|number_format(2) }}</td>
                    <td width="12%"  text-align="center" height="15">{{ ligne.article.prixAchatHt|number_format(3) }}</td>
                    <td width="7%"  text-align="center" height="15">{{ ligne.article.tauxTva|number_format(2) }}</td>
                        {% set montant_ht = ligne.article.prixAchatHt*ligne.quantiteBlanc %}
                        {% set total_ht = total_ht+montant_ht %}
                        {% set total_ttc = total_ttc+montant_ht*(1+ligne.article.tauxTva/100) %}
                    <td  text-align="center" height="15">{{ montant_ht|number_format(3) }}</td>
                </tr>
            </table>
            {% endif %}
            
         {% endfor %}    
            <table width="100%">
                <tr>
                    <td>Total Ht</td>
                    <td>{{total_ht|number_format(3)}}</td>
                </tr>
            </table>
            <table width="100%">
                <tr>
                    <td>Total TTC</td>
                    <td>{{total_ttc|number_format(3)}}</td>
                </tr>
            </table>
        </div>
    </dynamic-page>
</pdf>